package com.voice.server.repository;

import com.voice.server.entity.RoleFunction;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/*
 * @auther: wangjiacai
 *
 * @create: 2018-04-23 11:54:50
 */
public interface RoleFunctionRepository extends JpaRepository<RoleFunction,String> {


    @Query("select functionId from RoleFunction where roleId in (?1)")
    List<String> findFunctionIdByRoleIdIn(List<String> roleIds);

    @Query("select functionId from RoleFunction where roleId = ?1")
    List<String> findFunctionIdByRoleId(String roleId);

    void deleteByFunctionId(String functionId);

    void deleteByRoleId(String roleId);
}
